package com.songcan.oauth.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.songcan.model.oauth.SysOrganizational;
import com.songcan.oauth.service.SysOrganizationalService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * 业务代理商，商户组织架构
 */
@AllArgsConstructor
@RestController
@RequestMapping("rest/organizational")
public class OrganizationalController {


    private final SysOrganizationalService organizationalService;

    @GetMapping("/list")
    public IPage<SysOrganizational> pageList(@RequestParam(defaultValue = "1")Integer page,
                                             @RequestParam(defaultValue = "20")Integer pageSize){
        return organizationalService.page(new Page<>(page,pageSize));
    }
}
